import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
import { setupRouterGuards } from './guards'

import { allRoutes } from './all-routes'
export const router = createRouter({
    history:
        import.meta.env.VITE_USE_HASH === 'true'
            ? createWebHashHistory("/")
            : createWebHistory("/"),
    routes: allRoutes,
    scrollBehavior: () => ({ left: 0, top: 0 }),
})

export async function setupRouter(app) {
    app.use(router)
    //   setupRouterGuards(router)
}

export * from './guards'